<?php

namespace App\Http\Resources\Course;

use Illuminate\Http\Resources\Json\JsonResource;

class CourseListResource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'id'             => $this->id,
            'name'           => $this->name,
            'cover'          => $this->cover,
            'watch_num'      => $this->watch_num,
            'is_pay'         => $this->is_pay,
            'pay_amount'     => fen_to_yuan($this->pay_amount),
            'vip_is_pay'     => $this->vip_is_pay,
            'vip_pay_amount' => fen_to_yuan($this->vip_pay_amount),
        ];
    }
}
